<!DOCTYPE html>
<html>
<head>
	<meta charset="utf-8">
	<title>等级查询</title>
	<script type="text/javascript" src='jquery-3.2.1.min.js'></script>
</head>
<body>
<form method="get">
  <p>输入成绩: <input type="text" name="score" /> 等级: <span id='result'></span></p>
</form>
 <button id="send">提交</button>
</body>
  <script type="text/javascript">
		 $(function(){
		  $("#send").click(function(){
		   var cont = $("input").serialize();
		   $.ajax({
		    url:'ajax.php',
		    type:'get',
		    dataType:'json',
		    data:cont,
		    success:function(data){
		    	//console.log(data)
		     var str = data;
		     $("#result").html(str);
		    }
		   });
		  });  
		 });
    </script>
</html>